package pri.black.garden.domain;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.LinkedList;
import java.util.List;

@Data
@TableName("garden_block")
public class Block {
    @TableId(type = IdType.AUTO)
    private Long id;

    @TableField("pid")
    private Long pid;

    @TableField("list_order")
    private Integer listOrder;

    @TableField("name")
    private String name;

    @TableField("description")
    private String description;

    @TableField("create_time")
    private LocalDateTime createTime;

    @TableLogic(value = "0",delval = "1")
    @TableField("del_flag")
    private Integer delFlag;

    @TableField("size")
    private Float size;

    @TableField("percent")
    private Float percent;

    @TableField(exist = false)
    private List<Block> children = new LinkedList<>();

    @TableField(exist = false)
    private boolean hasChildren = false;

    @TableField(exist = false)
    private Block parent;
}
